﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Text;

namespace UtilZ.Dotnet.Ex.Communication.Net.Base
{
    /// <summary>
    /// Tcp监听到客户端连接输出事件参数
    /// </summary>
    public class AcceptSocketArgs : EventArgs
    {
        /// <summary>
        /// 监听到Client连接的NetTcpListener
        /// </summary>
        public NetTcpListener Listener { get; private set; }

        /// <summary>
        /// 监听EndPoint
        /// </summary>
        public EndPoint ListenEndPoint { get; private set; }

        /// <summary>
        /// 监听到的客户端连接Socket
        /// </summary>
        public Socket Client { get; private set; }


        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="listener">NetTcpListener</param>
        /// <param name="listenEndPoint">监听EndPoint</param>
        /// <param name="client">监听到的客户端连接Socket</param>
        public AcceptSocketArgs(NetTcpListener listener, EndPoint listenEndPoint, Socket client)
        {
            this.Listener = listener;
            this.ListenEndPoint = listenEndPoint;
            this.Client = client;
        }
    }
}
